const PLATFORM = 'WX'
const DEV_APPID = 10
const PRO_APPID = 10
const HEADER = {
  appId: DEV_APPID,
  platform: PLATFORM,
  accessToken: localStorage.uuToken ? localStorage.uuToken : ''
}
const WALLET_HEADER = {
  appId: DEV_APPID,
  platform: PLATFORM,
  accessToken: localStorage.uuToken ? localStorage.uuToken : ''
}

let config = {
  DOMAIN: '',
  APPID: '10',
  HEADER: HEADER,
  WALLET_HEADER: WALLET_HEADER,
  IMGURL: 'http://hy-bucket-shop.oss-cn-shenzhen.aliyuncs.com/',
  talkHref: 'https://tb.53kf.com/code/wx/10160180/1',
  routeBase: ''
}

if (process.env.NODE_ENV === 'development') {
  // config.DOMAIN = process.env.API_HOST
  config.DOMAIN = 'http://app.uuhelper.net/'
  config.APPID = DEV_APPID
  config.HEADER.appId = config.APPID
  // console.log('HEADER.APPID:' + config.HEADER.APPID)
  // config.IMGURL = 'http://hy-bucket-shop.oss-cn-shenzhen.aliyuncs.com/'
  config.routeBase = 'uu'
} else {
  if (process.env.NODE_ENV === 'test') {
    // config.DOMAIN = process.env.API_HOST
    config.DOMAIN = 'http://app.uuhelper.net/'
    config.APPID = DEV_APPID
    config.HEADER.appId = config.APPID
    config.IMGURL = 'http://ch-shared-parking-bucket-sit.oss-cn-shenzhen.aliyuncs.com/'
    config.routeBase = 'dl'
  } else {
    config.DOMAIN = process.env.API_HOST
    config.APPID = PRO_APPID
    config.HEADER.appId = config.APPID
    config.IMGURL = 'http://hy-bucket-shop.oss-cn-shenzhen.aliyuncs.com/'
    config.routeBase = 'uu'
  }
}

export let CONFIG = config

export const ERR_OK = 0

export const options = {
  param: 'jsonpCallback'
}

export const IMGURL = process.env.NODE_ENV === 'development' ? 'http://ch-shared-parking-bucket-sit.oss-cn-shenzhen.aliyuncs.com/' : 'http://ch-shared-parking-bucket-sit.oss-cn-shenzhen.aliyuncs.com/'

export const WeChatOpenIdUrl = 'http://app.chparking.com/WeChat/toOauthWithUserInfo?requesturl='

// export const talkHref = 'https://tb.53kf.com/code/wx/10160180/1'

export const ysCONFIG = {
  crosPostUrl: 'https://bird.ioliu.cn/v1',
  contentType: 'application/x-www-form-urlencoded',
  appKey: 'f7817c14a62144119374e5c018e72e9c',
  appSecret: '5c111bcca1747863e41d9ffa48038a52'
}

export const BD_AK = `75pAB9xhs2R1GBOB9tpoDhqaZ5eWRQAW`

export const GD_KEY = `acf05bfe508470e70e28a2ee25f618cc`